package com.ma.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;

/**
 * @ProjectName: project
 * @Package: com.ma.entity
 * @ClassName: Files
 * @Author: YHHHH
 * @Description: 文件类
 * @Date: 2021/3/7 20:49
 * @Version: 1.0
 */
@Data
@Accessors(chain = true)
@TableName("files")
public class Files implements Serializable {

    @TableId(value = "id",type = IdType.AUTO)
    private Integer filesId;    //文件ID

    @TableField(value = "name")
    private String filesName;  //文件名

    @TableField("uploadTime")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:SS")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date uploadTime;    //上传时间

    @TableField("downcounts")
    private Integer downcounts; //下载次数

    @TableField("type")
    private String type;    //文件类型

    @TableField("size")
    private Long size;   //文件大小

    @TableField("url")
    private String url; //路径

    @TableField("teamId")
    private Integer teamId;     //小组id

    @TableField("sid")
    private String studentId;     //小组id

    @TableField(exist = false)
    private Student student;    //对应学生

    @TableField(exist = false)
    private Team team;  //对应小组

    @TableField(exist = false)
    private Project project;  //对应项目

}
